package membermodel

import "yundian/internel/pkg/dingo"

type MembersAttr func(model *MembersModel)

type MembersAttrs []MembersAttr

func (attrFunc MembersAttrs) Apply(model *MembersModel)  {
	for _,f := range attrFunc {
		f(model)
	}
}

func WithID(id int) MembersAttr {
	return func(model *MembersModel) { model.ID = id }
}

func WithRegFrom(regFrom string) MembersAttr {
	return func(model *MembersModel) { model.RegFrom = regFrom }
}

func WithHeadimgurl(headimgurl string) MembersAttr {
	return func(model *MembersModel) { model.Headimgurl = headimgurl }
}

func WithNickName(nickName string) MembersAttr {
	return func(model *MembersModel) { model.NickName = nickName }
}

func WithSex(sex int8) MembersAttr {
	return func(model *MembersModel) { model.Sex = sex }
}

func WithSubscribe(subscribe int8) MembersAttr {
	return func(model *MembersModel) { model.Subscribe = subscribe }
}

func WithBalance(balance int64) MembersAttr {
	return func(model *MembersModel) { model.Balance = balance }
}

func WithUnionid(unionid string) MembersAttr {
	return func(model *MembersModel) { model.Unionid = unionid }
}

func WithWxOpenid(wxOpenid string) MembersAttr {
	return func(model *MembersModel) { model.WxOpenid = wxOpenid }
}

func WithAppId(appId string) MembersAttr {
	return func(model *MembersModel) { model.AppId = appId }
}

func WithPhone(phone string) MembersAttr {
	return func(model *MembersModel) { model.Phone = phone }
}

func WithXcxOpenid(xcxOpenid string) MembersAttr {
	return func(model *MembersModel) { model.XcxOpenid = xcxOpenid }
}

func WithUUID(uuid string) MembersAttr {
	return func(model *MembersModel) { model.UUID = uuid }
}

func WithCountry(country string) MembersAttr {
	return func(model *MembersModel) { model.Country = country }
}

func WithProvince(province string) MembersAttr {
	return func(model *MembersModel) { model.Province = province }
}

func WithCity(city string) MembersAttr {
	return func(model *MembersModel) { model.City = city }
}

func WithCreateAt(createAt dingo.Time) MembersAttr {
	return func(model *MembersModel) { model.CreateAt = createAt }
}

func WithUpdateAt(updateAt dingo.Time) MembersAttr {
	return func(model *MembersModel) { model.UpdateAt = updateAt }
}
